import re

def update_common_mall_sku(smzdm):
    if smzdm.article_mall == '国美在线':
        m = re.search(r'\|2Ftuan\|', smzdm.remark) # http://tuan.gome.com.cn/deal/T8800439548.html
        if m:
            m = re.search(r'\|2F(T\d{7,12})\|', smzdm.remark)
            smzdm.commodity_sku = m.group(1)
            smzdm.mall_url = 'http://tuan.gome.com.cn/deal/%s.html' %m.group(1)
            if smzdm.mall_url: smzdm.active = True
        m = re.search(r'\|2Fitem\|', smzdm.remark) #http://item.gome.com.cn/9134520853-1123460573.html
        if not smzdm.active and m:
            m = re.search(r'\|2F([A-Za-z0-9]{1}\d{7,12})\|', smzdm.remark)
            n = re.search(r'\|(pop\d{7,12})\|', smzdm.remark)
            if m and n: # http://item.gome.com.cn/A0006226660-pop8010005075.html
            smzdm.commodity_sku = '%s-%s' %(m.group(1), n.group(1))
            smzdm.mall_url = 'http://item.gome.com.cn/%s-%s.html' %(m.group(1), n.group(1))
            if smzdm.mall_url: smzdm.active = True
    elif smzdm.article_mall == '中粮我买网':
        '''
        http://www.womai.com/Product-200-611102.htm
        http://www.womai.com/Product-0-532599.htm
        http://www.womai.com/Product-100-590727.htm
        '''


    return smzdm
